package com.jiangfeixiang.springbootblog.controller.admin;

import com.jiangfeixiang.springbootblog.entity.Users;
import com.jiangfeixiang.springbootblog.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: 姜飞祥
 * @Description: 管理员信息操作
 * @Date: Create in 2019/1/27/0027 13:51
 * @param: $params$
 * @return: $returns$
 */
@RequestMapping("/admin")
@Controller
public class UserController {

    @Autowired
    private UsersService usersService;

    /**
     * 管理员信息查询
     * @return
     */
    @RequestMapping(value = "/adminuser")
    public String userinfo(Users users, Model model){
        Users userInfo = usersService.getUserInfo(users);
        model.addAttribute("userInfo",userInfo);
        System.out.println(userInfo);
        return "admin/admin-user";
    }
}
